<!-- https://docs.camunda.org/manual/latest/reference/bpmn20/events/start-events/ -->
<template>
  <Common :element="element" :moddle="moddle" :bo="bo" @write="write">
    <template #detail>
      <slot name="eventDefinition" />
      <CollapseItem title="Start initiator">
        <FormItemInput
          v-if="propertyVisible('initiator')"
          slot="content"
          v-model="bo.initiator"
          label="Initiator"
          :rules="[{ message: $customTranslate('Must have max length {length}', { length: 255 }), trigger: 'blur', max: 255 }]"
          prop="initiator"
        />
      </CollapseItem>
    </template>
  </Common>
</template>

<script>
import Common from '../../embbed/Common'
import CollapseItem from '../../ui/CollapseItem'
import FormItemInput from '../../ui/FormItemInput'
import elementHelper from '../../../mixins/elementHelper'

export default {
  name: 'StartEvent',
  components: {
    Common,
    CollapseItem,
    FormItemInput
  },
  mixins: [elementHelper],
  watch: {
    'bo.initiator'(val) {
      this.write({ initiator: val })
    }
  }
}
</script>
